/**
 * 
 */
package com.door.erp.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 *  片区
 * @author xiaolongwei@gmail.com
 * 
 * 
 */
@Entity
@Table(name = "area", catalog = "door")
public class Area implements Serializable {
	private static final long serialVersionUID = 1L;
	private String name;
	/**
	 * 片区负责人
	 */
	private Employee employee;

	private long id;

	/**
	 * 备注
	 */
	private String remark;
	@Column(name = "name", nullable = false)
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@Id
	@GeneratedValue
	@Column(name = "id", unique = true, nullable = false)
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	@OneToOne(fetch=FetchType.EAGER,targetEntity=Employee.class)
	@JoinColumn(name = "employeeId",nullable = false)
	public Employee getEmployee() {
		return employee;
	}
	public void setEmployee(Employee employee) {
		this.employee = employee;
	}
	@Column(name = "remark")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
}
